<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <!-- <link rel="stylesheet" href="../tools/bootstrap-3.3.7-dist/css/bootstrap.min.css"> -->
  <link rel="stylesheet" href="../css/base.css">
  <link rel="stylesheet" href="../css/login.css">
</head>

<body>


  <form class="big">
    <h1>BK-2123商店账号登录</h1>
    <!-- 用户名 -->
    <div>
      <label for="username" class="col-sm-2 control-label">账号</label>
      <input name="name" type="text" id="username" class="form-control inputWidth" placeholder="用户名">
      <span id="xx" class="spanspan"></span>
    </div>
    <!-- 密码 -->
    <div>
      <label for="password" class="col-sm-2 control-label">密码</label>
      <input name="pwd1" id="password" type="password" class="form-control inputWidth" placeholder="密码">
    </div>

    <!-- 注册按钮 -->
    <div>
      <button type="submit" class="btn btn-default">登录</button>

      <button name="reset" class="btn btn-default">重置</button>

    </div>

    <span name="msg"></span>
  </form>

  <script src="../public/ajax.js"></script>
  <script src="../public/jquery.min.js"></script>

  <script src="../public/tools.js"></script>
  <script src="../js/login.js"></script>
  <script src="../js/cookie.js"></script>
  <script>

    const getId = myGetUrlVal();
    console.log(getId);
    if (getId.id !== undefined) {
      getNamePwd();
    }
    $('form').submit(function (e) {
      e.preventDefault();
      let name = $('[id="username"]').val();
      let pwd = $('[id="password"]').val();
      login(name, pwd);
    })
    $('[name = "reset"]').click(function () {
      $('[id="username"]').val('');
      $('[id="password"]').val('');
    })

  </script>

</body>

</html>